package com.study.jyg.rxjava2study.activity;

import android.os.Bundle;
import com.google.android.material.appbar.AppBarLayout;
import androidx.appcompat.widget.Toolbar;
import android.widget.TextView;

import com.study.jyg.rxjava2study.R;
import com.study.jyg.rxjava2study.base.BasicActivity;
import com.study.jyg.rxjava2study.finaly.FinalString;

import java.util.Objects;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * rxjava 使用详情
 */
public class RxjavaBaseCreateActivity extends BasicActivity {


    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.appBar)
    AppBarLayout appBar;
    @BindView(R.id.tvContent)
    TextView tvContent;

    private int type;

    @Override
    protected int getLayout() {
        return R.layout.activity_rxjava_base_create;
    }

    @Override
    protected void init() {
        type = Objects.requireNonNull(getIntent().getExtras()).getInt("type", 0);
    }

    @Override
    protected void initView() {
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(v -> finish());
        toolbar.setTitle("RxJava基础创建");
        switch (type){
            case 0:
                tvContent.setText(FinalString.RXJAVA_BASE);
                break;
            case 1:
                tvContent.setText(FinalString.RXJAVA_FASTCREATE);
                break;
            case 2:
                tvContent.setText(FinalString.RXJAVA_WAITCREATE);
                break;
        }
    }


}
